package com.tuo51.evaluate.domain.evaluatingV2;

import com.aliyun.openservices.shade.org.apache.commons.lang3.builder.HashCodeExclude;
import com.matt.commons.model.Domain;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.*;
import java.util.List;

/**
 * 月龄对应的操作，对应测评表的月单元格
 */

@Data
@Entity
@Table(name = "tb_evaluate_item")
@EqualsAndHashCode(callSuper = true)
public class EvaluateV2Item extends Domain{

    @Column(columnDefinition = "varchar(50) COMMENT '维度id' ")
    private String dimensionId;

    @Column(columnDefinition = "varchar(50) COMMENT '维度名字' ")
    private String dimensionName;

    @Column(columnDefinition = "int default 0 COMMENT '月龄'")
    private Integer month = 0;

    @Column(columnDefinition = "int default 0 COMMENT '测评题目的总分数，单项得分为这个分数除以问题数量, 格子里所有问题全部通过则分数等于当前月龄' ")
    private Integer score;

    @Column(columnDefinition = "int default 0 COMMENT '题目数量' ")
    private Integer questionCount = 0;

    @Column(columnDefinition = "varchar(500) COMMENT '发育状态，宝宝这阶段的发育状态' ")
    private String developmentStatus;

    @Column(columnDefinition = "varchar(500) COMMENT '培养建议，如何达成当前目标' ")
    private String bringUp;

    @Column(columnDefinition = "varchar(500) COMMENT '父母手册' ")
    private String parentManual;

    @Column(columnDefinition = "varchar(500) COMMENT '观察内容' ")
    private String observation;

    @Column(columnDefinition = "varchar(500) COMMENT '指导方案' ")
    private String guide;

    @OneToMany(fetch = FetchType.LAZY, mappedBy = "item")
    @OrderBy("indexOnPaper ASC")
    @HashCodeExclude
    private List<EvaluateV2Question> questions;

    @Transient
    private Integer dimensionCode;

    @Transient
    private Integer restUnpassToNextDimension;
}
